﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
   <!-- 包含公共的JSP代码片段 -->
	
<title>无线点餐平台</title>



<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<script type="text/javascript" src="style/js/page_common.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/sys/style/js/jquery.js"></script>    
<script type="text/javascript" src="${pageContext.request.contextPath}/sys/style/js/jquery.min.js"></script>  
<script type="text/javascript" src="${pageContext.request.contextPath}/sys/style/js/bootstrap.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/sys/style/js/ImgUpLoad.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/sys/style/js/fileinput.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/sys/style/js/fileinput.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/sys/style/js/fileinput_locale_zh.js"></script>
<script src="${pageContext.request.contextPath}/Customer/laydate/laydate.js"></script> 
<script type="text/javascript" src="${pageContext.request.contextPath}/sys/style/js/toastr.min.js"></script>
  
<link href="style/css/common_style_blue.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="style/css/index_1.css" />
<link href="${pageContext.request.contextPath}/sys/style/css/toastr.css" rel="stylesheet" />
<link href="${pageContext.request.contextPath}/sys/style/css/fileinput.css" rel="stylesheet" />
<link href="${pageContext.request.contextPath}/sys/style/css/fileinput.min.css" rel="stylesheet" />
<link href="${pageContext.request.contextPath}/sys/style/css/bootstrap.css" rel="stylesheet" />

</head>
<body>

<!-- 图片上传框 -->




<!-- 页面标题 -->
<div id="TitleArea">
	<div id="TitleArea_Head"></div>
	<div id="TitleArea_Title">
		<div id="TitleArea_Title_Content">
			
				
				
					<img border="0" width="13" height="13" src="style/images/title_arrow.gif"/> 添加新菜品
				
			
		</div>
    </div>
	<div id="TitleArea_End"></div>
</div>

<!-- 主内容区域（数据列表或表单显示） -->
<div id="MainArea">
	<!-- 表单内容 -->
	<form  action="${pageContext.request.contextPath}/MenuAddAction" method="post" 
	            enctype="multipart/form-data" onSubmit="return myCheck()">
		<!-- 本段标题（分段标题） -->
		<div class="ItemBlock_Title">
        	<img width="4" height="7" border="0" src="style/images/item_point.gif"> 菜品信息&nbsp;
        </div>
		<!-- 本段表单字段 -->
        <div class="ItemBlockBorder">
            <div class="ItemBlock">
				<div class="ItemBlock2">
					<table cellpadding="0" cellspacing="0" class="mainForm">
                    <tr>
							<td width="80px">菜系</td>
							<td>
                            <select  name="menu.m_type" style="width:80px">
	                            
			   						<option value="1" 
			   							
			   						>粤菜</option>
			   						
			   					
			   						<option value="2" 
			   							
			   						>川菜</option>
			   						
			   					
			   						<option value="3" 
			   							
			   						>湘菜</option>
			   						
			   					
			   						<option value="4" 
			   							
			   						>东北菜</option>
			   						
			   					
                            </select>
                             *<input type="hidden" name="id" value="" /></td>
						
						</tr>
						
						
						
						<tr>
							<td width="80px">菜名</td>
							<td><input id="caiming" value=""  type="text" name="menu.m_name" class="InputStyle" /> *</td>
						</tr>
						
						<tr>
							<td>菜品价格</td>
							<td><input id="jiage" type="text" name="menu.m_price" class="InputStyle" value=""/> *</td>
						</tr>
                        <tr>
							<td>菜品上架时间</td>
							
							<td><input id="time" type="text" name="menu.m_time"  placeholder="请输入日期" class="laydate-icon" onclick="laydate()"/ value=""></td>
						</tr>
						<tr>
							<td>菜品状态</td>
							<td><input id="zt" type="text" name="menu.m_status" class="InputStyle" value=""/> *</td>
						</tr>
						
						<tr>
							<td>菜品描述</td>
							<td><textarea name="menu.m_describe" class="TextareaStyle"></textarea></td>
						</tr>
						
						
						<tr>
								
									<td width="80px">菜品图片</td>
										<input type="hidden" value="" name="menu.m_url_defal" id="img_input"/>
									<td><img src="meiyou" id="imgg" height="100px" width="100px" /></td> 
						</tr>
						
						
						<tr>
							<td></td>
							<td>
								<input id="input-id" type="file" class="file" name="file"/>
							</td>
						</tr>
					</table>
					
				</div>
            </div>
        </div>

		
		
		<!-- 表单操作 -->
		<div id="InputDetailBar">
         <input type="submit" name="button" id="button" value="添加" class="FunctionButtonInput">
         
          <a href="javascript:history.go(-1);" class="FunctionButton">返回</a>
        </div>
	</form>
</div>

	
<script type="text/javascript">


			function myCheck()
			{		
				if(document.getElementById("caiming").value=="")
				{	
					toastr.error("菜名不能为空");
					return false;
				}if(document.getElementById("zt").value==""){
				    toastr.error("状态一定不能为空");
					return false;
				}if(document.getElementById("time").value==""){
				    toastr.error("时间不能为空");
					return false;
				}if(document.getElementById("jiage").value==""){
				    toastr.error("价格不能为空");
					return false;
				}
				
				
				
				return true;
			}
			
			
			/*第一次进来把图片设置为未上传*/
			var a = document.getElementById("imgg").src;
			a = a.substring(a.lastIndexOf('/')+1,a.length);
			if(a=="meiyou")
			{
				document.getElementById("imgg").src="/OrderSystem/img/UnUpLoadImg.png";
			}
			
			
			
			laydate
			({
           		elem: '#demo'
            })
            
             toastr.options.positionClass = 'toast-bottom-right'; //初始化 toastr 提示插件
			 /* toastr.success('提交数据成功');
				toastr.error('Error');
				toastr.warning('只能选择一行进行编辑');
				toastr.info('info'); */
             toastr.options = {  
							        closeButton: true,  
							        debug: false,  
							        progressBar: true,  
							        positionClass: "toast-top-full-width",  
							        onclick: null,  
							        showDuration: "300",  
							        hideDuration: "1000",  
							        timeOut: "2000",  
							        extendedTimeOut: "1000",  
							        showEasing: "swing",  
							        hideEasing: "linear",  
							        showMethod: "fadeIn",  
							        hideMethod: "fadeOut"  
							    };    
               
                 
          

</script>	


		
</body>
</html>
